﻿using System.Collections.Generic;
using Newtonsoft.Json;
using CsvHelper.Configuration;

namespace AIC_Notification
{
    public class Teacher
    {
        public string Name { get; set; }
        public string Type { get; set; }
        public string City { get; set; }
        public string Email { get; set; }
        public IList<SOF_Application> Students;
        public IList<Guidance_Application> GuidanceStudents;
        public IList<RallySchoolStatistics> RallySchoolStatsList;

        [JsonIgnore]
        public RallyOfRallySchoolStatistics RallyOfRallySchoolStats;

        [JsonIgnore]
        public AggregatedStatistics ApplicationStats;

        public Teacher()
        {
            Students = new List<SOF_Application>();
            GuidanceStudents = new List<Guidance_Application>();
            RallySchoolStatsList = new List<RallySchoolStatistics>();
            ApplicationStats = new AggregatedStatistics();
            RallyOfRallySchoolStats = new RallyOfRallySchoolStatistics();
        }

        public void Reset()
        {
            Students.Clear();
            GuidanceStudents.Clear();
            RallySchoolStatsList.Clear();
            RallyOfRallySchoolStats.Reset();
        }
    }

    public sealed class TeacherMap : ClassMap<Teacher>
    {
        public TeacherMap()
        {
            Map(m => m.Name).Index(0);
            Map(m => m.Type).Index(1);
            Map(m => m.City).Index(2);
            Map(m => m.Email).Index(4);
        }
    }
}
